package com.learn.mybatis.k8s;

import com.learn.mybatis.k8s.config.MybatisProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@MapperScan({"com.learn.mybatis.*.mapper"})
@SpringBootApplication
@EnableConfigurationProperties({MybatisProperties.class})
//@Import(LearnMyBatisAutoConfiguration.class) // 把这个配置类也交给Spring boot源码进行管理
public class SpringBootMybatisK8sApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootMybatisK8sApplication.class, args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
